{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Otto商品分类——LightGBM，测试\n",
    "原始特征+tfidf特征"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们以Kaggle 2015年举办的Otto Group Product Classification Challenge竞赛数据为例。\n",
    "\n",
    "Otto数据集是著名电商Otto提供的一个多类商品分类问题，类别数=9. 每个样本有93维数值型特征（整数，表示某种事件发生的次数，已经进行过脱敏处理）。 竞赛官网：https://www.kaggle.com/c/otto-group-product-classification-challenge/data\n",
    "\n",
    "\n",
    "第一名：https://www.kaggle.com/c/otto-group-product-classification-challenge/discussion/14335\n",
    "第二名：http://blog.kaggle.com/2015/06/09/otto-product-classification-winners-interview-2nd-place-alexander-guschin/"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 首先 import 必要的模块\n",
    "import pandas as pd \n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 读取数据 & 数据探索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>feat_1</th>\n",
       "      <th>feat_2</th>\n",
       "      <th>feat_3</th>\n",
       "      <th>feat_4</th>\n",
       "      <th>feat_5</th>\n",
       "      <th>feat_6</th>\n",
       "      <th>feat_7</th>\n",
       "      <th>feat_8</th>\n",
       "      <th>feat_9</th>\n",
       "      <th>...</th>\n",
       "      <th>feat_84_tfidf</th>\n",
       "      <th>feat_85_tfidf</th>\n",
       "      <th>feat_86_tfidf</th>\n",
       "      <th>feat_87_tfidf</th>\n",
       "      <th>feat_88_tfidf</th>\n",
       "      <th>feat_89_tfidf</th>\n",
       "      <th>feat_90_tfidf</th>\n",
       "      <th>feat_91_tfidf</th>\n",
       "      <th>feat_92_tfidf</th>\n",
       "      <th>feat_93_tfidf</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.421803</td>\n",
       "      <td>0.052224</td>\n",
       "      <td>0.842245</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>0.032787</td>\n",
       "      <td>0.039216</td>\n",
       "      <td>0.21875</td>\n",
       "      <td>0.228571</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.143963</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.070171</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.019608</td>\n",
       "      <td>0.18750</td>\n",
       "      <td>0.014286</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.078248</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.071995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.014286</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.139311</td>\n",
       "      <td>0.034257</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>0.016393</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.014286</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.026316</td>\n",
       "      <td>0.026316</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.556178</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 187 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   id    feat_1    feat_2   feat_3    feat_4  feat_5  feat_6    feat_7  \\\n",
       "0   1  0.000000  0.000000  0.00000  0.000000     0.0     0.0  0.000000   \n",
       "1   2  0.032787  0.039216  0.21875  0.228571     0.0     0.0  0.000000   \n",
       "2   3  0.000000  0.019608  0.18750  0.014286     0.0     0.0  0.000000   \n",
       "3   4  0.000000  0.000000  0.00000  0.014286     0.0     0.0  0.000000   \n",
       "4   5  0.016393  0.000000  0.00000  0.014286     0.0     0.0  0.026316   \n",
       "\n",
       "     feat_8  feat_9  ...  feat_84_tfidf  feat_85_tfidf  feat_86_tfidf  \\\n",
       "0  0.000000     0.0  ...            0.0       0.000000       0.421803   \n",
       "1  0.000000     0.0  ...            0.0       0.000000       0.000000   \n",
       "2  0.000000     0.0  ...            0.0       0.000000       0.000000   \n",
       "3  0.000000     0.0  ...            0.0       0.139311       0.034257   \n",
       "4  0.026316     0.0  ...            0.0       0.000000       0.000000   \n",
       "\n",
       "   feat_87_tfidf  feat_88_tfidf  feat_89_tfidf  feat_90_tfidf  feat_91_tfidf  \\\n",
       "0       0.052224       0.842245       0.000000            0.0       0.000000   \n",
       "1       0.000000       0.000000       0.143963            0.0       0.000000   \n",
       "2       0.000000       0.078248       0.000000            0.0       0.000000   \n",
       "3       0.000000       0.000000       0.000000            0.0       0.000000   \n",
       "4       0.000000       0.000000       0.000000            0.0       0.556178   \n",
       "\n",
       "   feat_92_tfidf  feat_93_tfidf  \n",
       "0       0.000000       0.000000  \n",
       "1       0.070171       0.000000  \n",
       "2       0.000000       0.071995  \n",
       "3       0.000000       0.000000  \n",
       "4       0.000000       0.000000  \n",
       "\n",
       "[5 rows x 187 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读取数据\n",
    "# 请自行在log(x+1)特征和tf_idf特征上尝试，并比较不同特征的结果，\n",
    "# 我们可以采用stacking的方式组合这几种不同特征编码的得到的模型\n",
    "# path to where the data lies\n",
    "dpath = './data/'\n",
    "test1 = pd.read_csv(dpath +\"Otto_FE_test_org.csv\")\n",
    "#test = pd.read_csv(dpath +\"Otto_FE_test_log.csv\")\n",
    "test2 = pd.read_csv(dpath +\"Otto_FE_test_tfidf.csv\")\n",
    "\n",
    "#去掉多余的id\n",
    "test2 = test2.drop([\"id\"], axis=1)\n",
    "test =  pd.concat([test1, test2], axis = 1, ignore_index=False)\n",
    "test.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 准备数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_id = test['id']   \n",
    "X_test = test.drop([\"id\"], axis=1)\n",
    "\n",
    "#保存特征名字以备后用（可视化）\n",
    "feat_names = X_test.columns \n",
    "\n",
    "#sklearn的学习器大多之一稀疏数据输入，模型训练会快很多\n",
    "#查看一个学习器是否支持稀疏数据，可以看fit函数是否支持: X: {array-like, sparse matrix}.\n",
    "#可自行用timeit比较稠密数据和稀疏数据的训练时间\n",
    "from scipy.sparse import csr_matrix\n",
    "X_test = csr_matrix(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "#load训练好的模型\n",
    "import _pickle as cPickle\n",
    "\n",
    "model = cPickle.load(open('./data/'+\"Otto_LightGBM_org_tfidf.pkl\", 'rb'))\n",
    "\n",
    "#输出每类的概率\n",
    "y_test_pred = model.predict_proba(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(144368, 9)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_test_pred.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#生成提交结果\n",
    "out_df = pd.DataFrame(y_test_pred)\n",
    "\n",
    "columns = np.empty(9, dtype=object)\n",
    "for i in range(9):\n",
    "    columns[i] = 'Class_' + str(i+1)\n",
    "\n",
    "out_df.columns = columns\n",
    "\n",
    "out_df = pd.concat([test_id,out_df], axis = 1)\n",
    "out_df.to_csv('./data/'+\"LightGBM_org_tfidf.csv\", index=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "原始特征和tfidf两种特征\n",
    "Logistic回归：在Kaggle的Private Leaderboard分数0.59817（排名第2243位）\n",
    "RBF核SVM（只有tfidf特征）：0.48947（排名1254位）\n",
    "CART：1.07144（交叉验证估计的测试误差很准，可惜性能太差），单棵决策树性能不好\n",
    "RF：0.52848\n",
    "XGBoost:0.44729（只用原始特征，排名第636位）\n",
    "LightGBM：0.44366（排名567位）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>Class_1</th>\n",
       "      <th>Class_2</th>\n",
       "      <th>Class_3</th>\n",
       "      <th>Class_4</th>\n",
       "      <th>Class_5</th>\n",
       "      <th>Class_6</th>\n",
       "      <th>Class_7</th>\n",
       "      <th>Class_8</th>\n",
       "      <th>Class_9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0.000349</td>\n",
       "      <td>0.105256</td>\n",
       "      <td>0.149022</td>\n",
       "      <td>0.736090</td>\n",
       "      <td>3.550331e-06</td>\n",
       "      <td>0.000833</td>\n",
       "      <td>0.008042</td>\n",
       "      <td>0.000293</td>\n",
       "      <td>0.000110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>0.002604</td>\n",
       "      <td>0.005690</td>\n",
       "      <td>0.001021</td>\n",
       "      <td>0.000321</td>\n",
       "      <td>7.558035e-05</td>\n",
       "      <td>0.746772</td>\n",
       "      <td>0.001280</td>\n",
       "      <td>0.239719</td>\n",
       "      <td>0.002517</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>0.000023</td>\n",
       "      <td>0.000033</td>\n",
       "      <td>0.000027</td>\n",
       "      <td>0.000008</td>\n",
       "      <td>2.296413e-07</td>\n",
       "      <td>0.999156</td>\n",
       "      <td>0.000028</td>\n",
       "      <td>0.000706</td>\n",
       "      <td>0.000019</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>0.000708</td>\n",
       "      <td>0.559365</td>\n",
       "      <td>0.428354</td>\n",
       "      <td>0.010264</td>\n",
       "      <td>5.874674e-06</td>\n",
       "      <td>0.000176</td>\n",
       "      <td>0.000169</td>\n",
       "      <td>0.000364</td>\n",
       "      <td>0.000594</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>0.114015</td>\n",
       "      <td>0.000571</td>\n",
       "      <td>0.001207</td>\n",
       "      <td>0.000129</td>\n",
       "      <td>5.944135e-06</td>\n",
       "      <td>0.005354</td>\n",
       "      <td>0.002910</td>\n",
       "      <td>0.087132</td>\n",
       "      <td>0.788676</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>0.000081</td>\n",
       "      <td>0.231604</td>\n",
       "      <td>0.763924</td>\n",
       "      <td>0.000234</td>\n",
       "      <td>2.987142e-05</td>\n",
       "      <td>0.001048</td>\n",
       "      <td>0.000302</td>\n",
       "      <td>0.002713</td>\n",
       "      <td>0.000064</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>0.000792</td>\n",
       "      <td>0.002579</td>\n",
       "      <td>0.001747</td>\n",
       "      <td>0.001652</td>\n",
       "      <td>3.358912e-07</td>\n",
       "      <td>0.003258</td>\n",
       "      <td>0.005697</td>\n",
       "      <td>0.983939</td>\n",
       "      <td>0.000336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>0.000034</td>\n",
       "      <td>0.969378</td>\n",
       "      <td>0.017521</td>\n",
       "      <td>0.011517</td>\n",
       "      <td>1.612124e-06</td>\n",
       "      <td>0.000022</td>\n",
       "      <td>0.001481</td>\n",
       "      <td>0.000008</td>\n",
       "      <td>0.000037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>0.000897</td>\n",
       "      <td>0.306710</td>\n",
       "      <td>0.554107</td>\n",
       "      <td>0.130787</td>\n",
       "      <td>2.490020e-06</td>\n",
       "      <td>0.000140</td>\n",
       "      <td>0.007138</td>\n",
       "      <td>0.000087</td>\n",
       "      <td>0.000132</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>0.016970</td>\n",
       "      <td>0.406763</td>\n",
       "      <td>0.051106</td>\n",
       "      <td>0.001597</td>\n",
       "      <td>2.842435e-03</td>\n",
       "      <td>0.030352</td>\n",
       "      <td>0.015950</td>\n",
       "      <td>0.469304</td>\n",
       "      <td>0.005115</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>0.011527</td>\n",
       "      <td>0.370021</td>\n",
       "      <td>0.361042</td>\n",
       "      <td>0.108172</td>\n",
       "      <td>2.022621e-04</td>\n",
       "      <td>0.002483</td>\n",
       "      <td>0.142456</td>\n",
       "      <td>0.001711</td>\n",
       "      <td>0.002386</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>0.071168</td>\n",
       "      <td>0.000759</td>\n",
       "      <td>0.000528</td>\n",
       "      <td>0.000226</td>\n",
       "      <td>3.842423e-05</td>\n",
       "      <td>0.027767</td>\n",
       "      <td>0.000355</td>\n",
       "      <td>0.008581</td>\n",
       "      <td>0.890578</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>13</td>\n",
       "      <td>0.000010</td>\n",
       "      <td>0.000053</td>\n",
       "      <td>0.000003</td>\n",
       "      <td>0.000051</td>\n",
       "      <td>9.998409e-01</td>\n",
       "      <td>0.000008</td>\n",
       "      <td>0.000006</td>\n",
       "      <td>0.000019</td>\n",
       "      <td>0.000009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>14</td>\n",
       "      <td>0.000195</td>\n",
       "      <td>0.942713</td>\n",
       "      <td>0.034885</td>\n",
       "      <td>0.010262</td>\n",
       "      <td>1.553786e-05</td>\n",
       "      <td>0.001435</td>\n",
       "      <td>0.002757</td>\n",
       "      <td>0.002504</td>\n",
       "      <td>0.005233</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>15</td>\n",
       "      <td>0.007294</td>\n",
       "      <td>0.709019</td>\n",
       "      <td>0.179091</td>\n",
       "      <td>0.016542</td>\n",
       "      <td>2.522622e-04</td>\n",
       "      <td>0.003952</td>\n",
       "      <td>0.009172</td>\n",
       "      <td>0.005131</td>\n",
       "      <td>0.069546</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>16</td>\n",
       "      <td>0.181491</td>\n",
       "      <td>0.000627</td>\n",
       "      <td>0.000715</td>\n",
       "      <td>0.000144</td>\n",
       "      <td>8.334581e-07</td>\n",
       "      <td>0.030999</td>\n",
       "      <td>0.121309</td>\n",
       "      <td>0.661504</td>\n",
       "      <td>0.003209</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>17</td>\n",
       "      <td>0.001010</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>0.000008</td>\n",
       "      <td>0.000066</td>\n",
       "      <td>1.548224e-07</td>\n",
       "      <td>0.998194</td>\n",
       "      <td>0.000121</td>\n",
       "      <td>0.000308</td>\n",
       "      <td>0.000278</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>18</td>\n",
       "      <td>0.000019</td>\n",
       "      <td>0.000053</td>\n",
       "      <td>0.000045</td>\n",
       "      <td>0.000014</td>\n",
       "      <td>4.574021e-07</td>\n",
       "      <td>0.999582</td>\n",
       "      <td>0.000046</td>\n",
       "      <td>0.000184</td>\n",
       "      <td>0.000057</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>19</td>\n",
       "      <td>0.000021</td>\n",
       "      <td>0.000089</td>\n",
       "      <td>0.000006</td>\n",
       "      <td>0.000268</td>\n",
       "      <td>9.994017e-01</td>\n",
       "      <td>0.000106</td>\n",
       "      <td>0.000055</td>\n",
       "      <td>0.000041</td>\n",
       "      <td>0.000012</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20</td>\n",
       "      <td>0.000178</td>\n",
       "      <td>0.780884</td>\n",
       "      <td>0.104023</td>\n",
       "      <td>0.101229</td>\n",
       "      <td>2.424846e-06</td>\n",
       "      <td>0.003806</td>\n",
       "      <td>0.003757</td>\n",
       "      <td>0.000348</td>\n",
       "      <td>0.005772</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>21</td>\n",
       "      <td>0.000350</td>\n",
       "      <td>0.000065</td>\n",
       "      <td>0.000004</td>\n",
       "      <td>0.000302</td>\n",
       "      <td>9.344038e-07</td>\n",
       "      <td>0.997860</td>\n",
       "      <td>0.000060</td>\n",
       "      <td>0.000672</td>\n",
       "      <td>0.000686</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>22</td>\n",
       "      <td>0.024931</td>\n",
       "      <td>0.000250</td>\n",
       "      <td>0.000318</td>\n",
       "      <td>0.000023</td>\n",
       "      <td>9.048936e-07</td>\n",
       "      <td>0.002782</td>\n",
       "      <td>0.013697</td>\n",
       "      <td>0.956876</td>\n",
       "      <td>0.001123</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>23</td>\n",
       "      <td>0.003029</td>\n",
       "      <td>0.574576</td>\n",
       "      <td>0.176143</td>\n",
       "      <td>0.223150</td>\n",
       "      <td>9.869048e-06</td>\n",
       "      <td>0.001816</td>\n",
       "      <td>0.009271</td>\n",
       "      <td>0.002284</td>\n",
       "      <td>0.009722</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>24</td>\n",
       "      <td>0.037456</td>\n",
       "      <td>0.002647</td>\n",
       "      <td>0.001425</td>\n",
       "      <td>0.000626</td>\n",
       "      <td>5.892140e-05</td>\n",
       "      <td>0.037806</td>\n",
       "      <td>0.001554</td>\n",
       "      <td>0.864311</td>\n",
       "      <td>0.054115</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>25</td>\n",
       "      <td>0.142323</td>\n",
       "      <td>0.001010</td>\n",
       "      <td>0.000335</td>\n",
       "      <td>0.000513</td>\n",
       "      <td>2.744368e-05</td>\n",
       "      <td>0.078497</td>\n",
       "      <td>0.001399</td>\n",
       "      <td>0.023162</td>\n",
       "      <td>0.752736</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>26</td>\n",
       "      <td>0.004778</td>\n",
       "      <td>0.000150</td>\n",
       "      <td>0.000102</td>\n",
       "      <td>0.000017</td>\n",
       "      <td>1.207166e-06</td>\n",
       "      <td>0.000284</td>\n",
       "      <td>0.000801</td>\n",
       "      <td>0.993436</td>\n",
       "      <td>0.000432</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>27</td>\n",
       "      <td>0.000018</td>\n",
       "      <td>0.017464</td>\n",
       "      <td>0.964565</td>\n",
       "      <td>0.017568</td>\n",
       "      <td>6.986143e-07</td>\n",
       "      <td>0.000087</td>\n",
       "      <td>0.000182</td>\n",
       "      <td>0.000055</td>\n",
       "      <td>0.000060</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>28</td>\n",
       "      <td>0.000705</td>\n",
       "      <td>0.823777</td>\n",
       "      <td>0.161799</td>\n",
       "      <td>0.009873</td>\n",
       "      <td>2.742309e-05</td>\n",
       "      <td>0.000871</td>\n",
       "      <td>0.001081</td>\n",
       "      <td>0.000754</td>\n",
       "      <td>0.001113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>29</td>\n",
       "      <td>0.000045</td>\n",
       "      <td>0.610688</td>\n",
       "      <td>0.379282</td>\n",
       "      <td>0.009607</td>\n",
       "      <td>2.772027e-06</td>\n",
       "      <td>0.000108</td>\n",
       "      <td>0.000119</td>\n",
       "      <td>0.000095</td>\n",
       "      <td>0.000052</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>30</td>\n",
       "      <td>0.000321</td>\n",
       "      <td>0.328636</td>\n",
       "      <td>0.667579</td>\n",
       "      <td>0.000280</td>\n",
       "      <td>3.957778e-06</td>\n",
       "      <td>0.000909</td>\n",
       "      <td>0.000748</td>\n",
       "      <td>0.000440</td>\n",
       "      <td>0.001083</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144338</th>\n",
       "      <td>144339</td>\n",
       "      <td>0.000974</td>\n",
       "      <td>0.312252</td>\n",
       "      <td>0.307663</td>\n",
       "      <td>0.079629</td>\n",
       "      <td>2.847141e-05</td>\n",
       "      <td>0.002670</td>\n",
       "      <td>0.287479</td>\n",
       "      <td>0.001520</td>\n",
       "      <td>0.007784</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144339</th>\n",
       "      <td>144340</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>0.000054</td>\n",
       "      <td>0.000057</td>\n",
       "      <td>0.000031</td>\n",
       "      <td>1.043775e-06</td>\n",
       "      <td>0.999526</td>\n",
       "      <td>0.000181</td>\n",
       "      <td>0.000086</td>\n",
       "      <td>0.000039</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144340</th>\n",
       "      <td>144341</td>\n",
       "      <td>0.011413</td>\n",
       "      <td>0.203078</td>\n",
       "      <td>0.146964</td>\n",
       "      <td>0.097624</td>\n",
       "      <td>8.311446e-06</td>\n",
       "      <td>0.059502</td>\n",
       "      <td>0.430248</td>\n",
       "      <td>0.036861</td>\n",
       "      <td>0.014302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144341</th>\n",
       "      <td>144342</td>\n",
       "      <td>0.000046</td>\n",
       "      <td>0.781834</td>\n",
       "      <td>0.189769</td>\n",
       "      <td>0.028198</td>\n",
       "      <td>8.656564e-07</td>\n",
       "      <td>0.000044</td>\n",
       "      <td>0.000084</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>0.000008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144342</th>\n",
       "      <td>144343</td>\n",
       "      <td>0.000003</td>\n",
       "      <td>0.000008</td>\n",
       "      <td>0.000004</td>\n",
       "      <td>0.000006</td>\n",
       "      <td>2.268598e-07</td>\n",
       "      <td>0.999915</td>\n",
       "      <td>0.000013</td>\n",
       "      <td>0.000041</td>\n",
       "      <td>0.000010</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144343</th>\n",
       "      <td>144344</td>\n",
       "      <td>0.000188</td>\n",
       "      <td>0.000049</td>\n",
       "      <td>0.000106</td>\n",
       "      <td>0.000009</td>\n",
       "      <td>6.171790e-07</td>\n",
       "      <td>0.002833</td>\n",
       "      <td>0.000709</td>\n",
       "      <td>0.994742</td>\n",
       "      <td>0.001364</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144344</th>\n",
       "      <td>144345</td>\n",
       "      <td>0.000031</td>\n",
       "      <td>0.888187</td>\n",
       "      <td>0.101304</td>\n",
       "      <td>0.010117</td>\n",
       "      <td>1.537235e-06</td>\n",
       "      <td>0.000060</td>\n",
       "      <td>0.000142</td>\n",
       "      <td>0.000136</td>\n",
       "      <td>0.000023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144345</th>\n",
       "      <td>144346</td>\n",
       "      <td>0.001806</td>\n",
       "      <td>0.000249</td>\n",
       "      <td>0.000100</td>\n",
       "      <td>0.001683</td>\n",
       "      <td>1.052447e-06</td>\n",
       "      <td>0.985300</td>\n",
       "      <td>0.001495</td>\n",
       "      <td>0.006177</td>\n",
       "      <td>0.003190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144346</th>\n",
       "      <td>144347</td>\n",
       "      <td>0.000047</td>\n",
       "      <td>0.000081</td>\n",
       "      <td>0.000027</td>\n",
       "      <td>0.000029</td>\n",
       "      <td>9.988922e-01</td>\n",
       "      <td>0.000112</td>\n",
       "      <td>0.000040</td>\n",
       "      <td>0.000543</td>\n",
       "      <td>0.000229</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144347</th>\n",
       "      <td>144348</td>\n",
       "      <td>0.000036</td>\n",
       "      <td>0.226573</td>\n",
       "      <td>0.441212</td>\n",
       "      <td>0.330664</td>\n",
       "      <td>3.446984e-06</td>\n",
       "      <td>0.000156</td>\n",
       "      <td>0.000503</td>\n",
       "      <td>0.000026</td>\n",
       "      <td>0.000828</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144348</th>\n",
       "      <td>144349</td>\n",
       "      <td>0.000307</td>\n",
       "      <td>0.772004</td>\n",
       "      <td>0.167987</td>\n",
       "      <td>0.055066</td>\n",
       "      <td>6.493382e-06</td>\n",
       "      <td>0.000402</td>\n",
       "      <td>0.000483</td>\n",
       "      <td>0.000065</td>\n",
       "      <td>0.003679</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144349</th>\n",
       "      <td>144350</td>\n",
       "      <td>0.000432</td>\n",
       "      <td>0.441079</td>\n",
       "      <td>0.537572</td>\n",
       "      <td>0.017473</td>\n",
       "      <td>4.040302e-05</td>\n",
       "      <td>0.000163</td>\n",
       "      <td>0.002881</td>\n",
       "      <td>0.000253</td>\n",
       "      <td>0.000105</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144350</th>\n",
       "      <td>144351</td>\n",
       "      <td>0.000782</td>\n",
       "      <td>0.000242</td>\n",
       "      <td>0.000120</td>\n",
       "      <td>0.000680</td>\n",
       "      <td>3.092507e-06</td>\n",
       "      <td>0.990103</td>\n",
       "      <td>0.003411</td>\n",
       "      <td>0.003764</td>\n",
       "      <td>0.000894</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144351</th>\n",
       "      <td>144352</td>\n",
       "      <td>0.000590</td>\n",
       "      <td>0.799679</td>\n",
       "      <td>0.188602</td>\n",
       "      <td>0.006301</td>\n",
       "      <td>1.217094e-04</td>\n",
       "      <td>0.001172</td>\n",
       "      <td>0.000851</td>\n",
       "      <td>0.002077</td>\n",
       "      <td>0.000605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144352</th>\n",
       "      <td>144353</td>\n",
       "      <td>0.002509</td>\n",
       "      <td>0.973317</td>\n",
       "      <td>0.008209</td>\n",
       "      <td>0.000812</td>\n",
       "      <td>4.171745e-06</td>\n",
       "      <td>0.001450</td>\n",
       "      <td>0.001661</td>\n",
       "      <td>0.010101</td>\n",
       "      <td>0.001937</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144353</th>\n",
       "      <td>144354</td>\n",
       "      <td>0.001497</td>\n",
       "      <td>0.002723</td>\n",
       "      <td>0.000530</td>\n",
       "      <td>0.000225</td>\n",
       "      <td>3.790479e-06</td>\n",
       "      <td>0.215298</td>\n",
       "      <td>0.000393</td>\n",
       "      <td>0.011322</td>\n",
       "      <td>0.768008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144354</th>\n",
       "      <td>144355</td>\n",
       "      <td>0.007216</td>\n",
       "      <td>0.019524</td>\n",
       "      <td>0.007271</td>\n",
       "      <td>0.000679</td>\n",
       "      <td>7.545768e-06</td>\n",
       "      <td>0.776319</td>\n",
       "      <td>0.104994</td>\n",
       "      <td>0.013425</td>\n",
       "      <td>0.070565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144355</th>\n",
       "      <td>144356</td>\n",
       "      <td>0.004063</td>\n",
       "      <td>0.000311</td>\n",
       "      <td>0.000026</td>\n",
       "      <td>0.000185</td>\n",
       "      <td>3.559530e-06</td>\n",
       "      <td>0.632360</td>\n",
       "      <td>0.001144</td>\n",
       "      <td>0.359529</td>\n",
       "      <td>0.002378</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144356</th>\n",
       "      <td>144357</td>\n",
       "      <td>0.217142</td>\n",
       "      <td>0.000045</td>\n",
       "      <td>0.000031</td>\n",
       "      <td>0.000040</td>\n",
       "      <td>7.367841e-07</td>\n",
       "      <td>0.001128</td>\n",
       "      <td>0.000641</td>\n",
       "      <td>0.774893</td>\n",
       "      <td>0.006079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144357</th>\n",
       "      <td>144358</td>\n",
       "      <td>0.000008</td>\n",
       "      <td>0.000135</td>\n",
       "      <td>0.000005</td>\n",
       "      <td>0.000017</td>\n",
       "      <td>9.997720e-01</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>0.000006</td>\n",
       "      <td>0.000022</td>\n",
       "      <td>0.000018</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144358</th>\n",
       "      <td>144359</td>\n",
       "      <td>0.000794</td>\n",
       "      <td>0.000112</td>\n",
       "      <td>0.000050</td>\n",
       "      <td>0.001805</td>\n",
       "      <td>2.144142e-06</td>\n",
       "      <td>0.986996</td>\n",
       "      <td>0.000999</td>\n",
       "      <td>0.002761</td>\n",
       "      <td>0.006481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144359</th>\n",
       "      <td>144360</td>\n",
       "      <td>0.000146</td>\n",
       "      <td>0.756213</td>\n",
       "      <td>0.186036</td>\n",
       "      <td>0.045327</td>\n",
       "      <td>7.966600e-06</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>0.006385</td>\n",
       "      <td>0.000598</td>\n",
       "      <td>0.005126</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144360</th>\n",
       "      <td>144361</td>\n",
       "      <td>0.001115</td>\n",
       "      <td>0.000191</td>\n",
       "      <td>0.000318</td>\n",
       "      <td>0.000091</td>\n",
       "      <td>3.406361e-06</td>\n",
       "      <td>0.013751</td>\n",
       "      <td>0.983524</td>\n",
       "      <td>0.000915</td>\n",
       "      <td>0.000092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144361</th>\n",
       "      <td>144362</td>\n",
       "      <td>0.000133</td>\n",
       "      <td>0.502318</td>\n",
       "      <td>0.450639</td>\n",
       "      <td>0.044576</td>\n",
       "      <td>3.807016e-05</td>\n",
       "      <td>0.000287</td>\n",
       "      <td>0.001318</td>\n",
       "      <td>0.000246</td>\n",
       "      <td>0.000444</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144362</th>\n",
       "      <td>144363</td>\n",
       "      <td>0.002747</td>\n",
       "      <td>0.041050</td>\n",
       "      <td>0.346344</td>\n",
       "      <td>0.310023</td>\n",
       "      <td>1.617885e-05</td>\n",
       "      <td>0.004748</td>\n",
       "      <td>0.279907</td>\n",
       "      <td>0.007291</td>\n",
       "      <td>0.007874</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144363</th>\n",
       "      <td>144364</td>\n",
       "      <td>0.466403</td>\n",
       "      <td>0.009495</td>\n",
       "      <td>0.003806</td>\n",
       "      <td>0.006494</td>\n",
       "      <td>6.455827e-06</td>\n",
       "      <td>0.434420</td>\n",
       "      <td>0.019892</td>\n",
       "      <td>0.015795</td>\n",
       "      <td>0.043689</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144364</th>\n",
       "      <td>144365</td>\n",
       "      <td>0.000525</td>\n",
       "      <td>0.300608</td>\n",
       "      <td>0.563402</td>\n",
       "      <td>0.072876</td>\n",
       "      <td>1.457008e-05</td>\n",
       "      <td>0.000837</td>\n",
       "      <td>0.061283</td>\n",
       "      <td>0.000122</td>\n",
       "      <td>0.000333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144365</th>\n",
       "      <td>144366</td>\n",
       "      <td>0.000211</td>\n",
       "      <td>0.482430</td>\n",
       "      <td>0.359697</td>\n",
       "      <td>0.148146</td>\n",
       "      <td>3.130433e-06</td>\n",
       "      <td>0.001326</td>\n",
       "      <td>0.007567</td>\n",
       "      <td>0.000346</td>\n",
       "      <td>0.000273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144366</th>\n",
       "      <td>144367</td>\n",
       "      <td>0.000028</td>\n",
       "      <td>0.333658</td>\n",
       "      <td>0.029212</td>\n",
       "      <td>0.636017</td>\n",
       "      <td>6.308267e-07</td>\n",
       "      <td>0.000008</td>\n",
       "      <td>0.001050</td>\n",
       "      <td>0.000007</td>\n",
       "      <td>0.000019</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144367</th>\n",
       "      <td>144368</td>\n",
       "      <td>0.000106</td>\n",
       "      <td>0.583036</td>\n",
       "      <td>0.361702</td>\n",
       "      <td>0.017925</td>\n",
       "      <td>9.257187e-06</td>\n",
       "      <td>0.000884</td>\n",
       "      <td>0.036131</td>\n",
       "      <td>0.000100</td>\n",
       "      <td>0.000105</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>144368 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            id   Class_1   Class_2   Class_3   Class_4       Class_5  \\\n",
       "0            1  0.000349  0.105256  0.149022  0.736090  3.550331e-06   \n",
       "1            2  0.002604  0.005690  0.001021  0.000321  7.558035e-05   \n",
       "2            3  0.000023  0.000033  0.000027  0.000008  2.296413e-07   \n",
       "3            4  0.000708  0.559365  0.428354  0.010264  5.874674e-06   \n",
       "4            5  0.114015  0.000571  0.001207  0.000129  5.944135e-06   \n",
       "5            6  0.000081  0.231604  0.763924  0.000234  2.987142e-05   \n",
       "6            7  0.000792  0.002579  0.001747  0.001652  3.358912e-07   \n",
       "7            8  0.000034  0.969378  0.017521  0.011517  1.612124e-06   \n",
       "8            9  0.000897  0.306710  0.554107  0.130787  2.490020e-06   \n",
       "9           10  0.016970  0.406763  0.051106  0.001597  2.842435e-03   \n",
       "10          11  0.011527  0.370021  0.361042  0.108172  2.022621e-04   \n",
       "11          12  0.071168  0.000759  0.000528  0.000226  3.842423e-05   \n",
       "12          13  0.000010  0.000053  0.000003  0.000051  9.998409e-01   \n",
       "13          14  0.000195  0.942713  0.034885  0.010262  1.553786e-05   \n",
       "14          15  0.007294  0.709019  0.179091  0.016542  2.522622e-04   \n",
       "15          16  0.181491  0.000627  0.000715  0.000144  8.334581e-07   \n",
       "16          17  0.001010  0.000015  0.000008  0.000066  1.548224e-07   \n",
       "17          18  0.000019  0.000053  0.000045  0.000014  4.574021e-07   \n",
       "18          19  0.000021  0.000089  0.000006  0.000268  9.994017e-01   \n",
       "19          20  0.000178  0.780884  0.104023  0.101229  2.424846e-06   \n",
       "20          21  0.000350  0.000065  0.000004  0.000302  9.344038e-07   \n",
       "21          22  0.024931  0.000250  0.000318  0.000023  9.048936e-07   \n",
       "22          23  0.003029  0.574576  0.176143  0.223150  9.869048e-06   \n",
       "23          24  0.037456  0.002647  0.001425  0.000626  5.892140e-05   \n",
       "24          25  0.142323  0.001010  0.000335  0.000513  2.744368e-05   \n",
       "25          26  0.004778  0.000150  0.000102  0.000017  1.207166e-06   \n",
       "26          27  0.000018  0.017464  0.964565  0.017568  6.986143e-07   \n",
       "27          28  0.000705  0.823777  0.161799  0.009873  2.742309e-05   \n",
       "28          29  0.000045  0.610688  0.379282  0.009607  2.772027e-06   \n",
       "29          30  0.000321  0.328636  0.667579  0.000280  3.957778e-06   \n",
       "...        ...       ...       ...       ...       ...           ...   \n",
       "144338  144339  0.000974  0.312252  0.307663  0.079629  2.847141e-05   \n",
       "144339  144340  0.000024  0.000054  0.000057  0.000031  1.043775e-06   \n",
       "144340  144341  0.011413  0.203078  0.146964  0.097624  8.311446e-06   \n",
       "144341  144342  0.000046  0.781834  0.189769  0.028198  8.656564e-07   \n",
       "144342  144343  0.000003  0.000008  0.000004  0.000006  2.268598e-07   \n",
       "144343  144344  0.000188  0.000049  0.000106  0.000009  6.171790e-07   \n",
       "144344  144345  0.000031  0.888187  0.101304  0.010117  1.537235e-06   \n",
       "144345  144346  0.001806  0.000249  0.000100  0.001683  1.052447e-06   \n",
       "144346  144347  0.000047  0.000081  0.000027  0.000029  9.988922e-01   \n",
       "144347  144348  0.000036  0.226573  0.441212  0.330664  3.446984e-06   \n",
       "144348  144349  0.000307  0.772004  0.167987  0.055066  6.493382e-06   \n",
       "144349  144350  0.000432  0.441079  0.537572  0.017473  4.040302e-05   \n",
       "144350  144351  0.000782  0.000242  0.000120  0.000680  3.092507e-06   \n",
       "144351  144352  0.000590  0.799679  0.188602  0.006301  1.217094e-04   \n",
       "144352  144353  0.002509  0.973317  0.008209  0.000812  4.171745e-06   \n",
       "144353  144354  0.001497  0.002723  0.000530  0.000225  3.790479e-06   \n",
       "144354  144355  0.007216  0.019524  0.007271  0.000679  7.545768e-06   \n",
       "144355  144356  0.004063  0.000311  0.000026  0.000185  3.559530e-06   \n",
       "144356  144357  0.217142  0.000045  0.000031  0.000040  7.367841e-07   \n",
       "144357  144358  0.000008  0.000135  0.000005  0.000017  9.997720e-01   \n",
       "144358  144359  0.000794  0.000112  0.000050  0.001805  2.144142e-06   \n",
       "144359  144360  0.000146  0.756213  0.186036  0.045327  7.966600e-06   \n",
       "144360  144361  0.001115  0.000191  0.000318  0.000091  3.406361e-06   \n",
       "144361  144362  0.000133  0.502318  0.450639  0.044576  3.807016e-05   \n",
       "144362  144363  0.002747  0.041050  0.346344  0.310023  1.617885e-05   \n",
       "144363  144364  0.466403  0.009495  0.003806  0.006494  6.455827e-06   \n",
       "144364  144365  0.000525  0.300608  0.563402  0.072876  1.457008e-05   \n",
       "144365  144366  0.000211  0.482430  0.359697  0.148146  3.130433e-06   \n",
       "144366  144367  0.000028  0.333658  0.029212  0.636017  6.308267e-07   \n",
       "144367  144368  0.000106  0.583036  0.361702  0.017925  9.257187e-06   \n",
       "\n",
       "         Class_6   Class_7   Class_8   Class_9  \n",
       "0       0.000833  0.008042  0.000293  0.000110  \n",
       "1       0.746772  0.001280  0.239719  0.002517  \n",
       "2       0.999156  0.000028  0.000706  0.000019  \n",
       "3       0.000176  0.000169  0.000364  0.000594  \n",
       "4       0.005354  0.002910  0.087132  0.788676  \n",
       "5       0.001048  0.000302  0.002713  0.000064  \n",
       "6       0.003258  0.005697  0.983939  0.000336  \n",
       "7       0.000022  0.001481  0.000008  0.000037  \n",
       "8       0.000140  0.007138  0.000087  0.000132  \n",
       "9       0.030352  0.015950  0.469304  0.005115  \n",
       "10      0.002483  0.142456  0.001711  0.002386  \n",
       "11      0.027767  0.000355  0.008581  0.890578  \n",
       "12      0.000008  0.000006  0.000019  0.000009  \n",
       "13      0.001435  0.002757  0.002504  0.005233  \n",
       "14      0.003952  0.009172  0.005131  0.069546  \n",
       "15      0.030999  0.121309  0.661504  0.003209  \n",
       "16      0.998194  0.000121  0.000308  0.000278  \n",
       "17      0.999582  0.000046  0.000184  0.000057  \n",
       "18      0.000106  0.000055  0.000041  0.000012  \n",
       "19      0.003806  0.003757  0.000348  0.005772  \n",
       "20      0.997860  0.000060  0.000672  0.000686  \n",
       "21      0.002782  0.013697  0.956876  0.001123  \n",
       "22      0.001816  0.009271  0.002284  0.009722  \n",
       "23      0.037806  0.001554  0.864311  0.054115  \n",
       "24      0.078497  0.001399  0.023162  0.752736  \n",
       "25      0.000284  0.000801  0.993436  0.000432  \n",
       "26      0.000087  0.000182  0.000055  0.000060  \n",
       "27      0.000871  0.001081  0.000754  0.001113  \n",
       "28      0.000108  0.000119  0.000095  0.000052  \n",
       "29      0.000909  0.000748  0.000440  0.001083  \n",
       "...          ...       ...       ...       ...  \n",
       "144338  0.002670  0.287479  0.001520  0.007784  \n",
       "144339  0.999526  0.000181  0.000086  0.000039  \n",
       "144340  0.059502  0.430248  0.036861  0.014302  \n",
       "144341  0.000044  0.000084  0.000015  0.000008  \n",
       "144342  0.999915  0.000013  0.000041  0.000010  \n",
       "144343  0.002833  0.000709  0.994742  0.001364  \n",
       "144344  0.000060  0.000142  0.000136  0.000023  \n",
       "144345  0.985300  0.001495  0.006177  0.003190  \n",
       "144346  0.000112  0.000040  0.000543  0.000229  \n",
       "144347  0.000156  0.000503  0.000026  0.000828  \n",
       "144348  0.000402  0.000483  0.000065  0.003679  \n",
       "144349  0.000163  0.002881  0.000253  0.000105  \n",
       "144350  0.990103  0.003411  0.003764  0.000894  \n",
       "144351  0.001172  0.000851  0.002077  0.000605  \n",
       "144352  0.001450  0.001661  0.010101  0.001937  \n",
       "144353  0.215298  0.000393  0.011322  0.768008  \n",
       "144354  0.776319  0.104994  0.013425  0.070565  \n",
       "144355  0.632360  0.001144  0.359529  0.002378  \n",
       "144356  0.001128  0.000641  0.774893  0.006079  \n",
       "144357  0.000015  0.000006  0.000022  0.000018  \n",
       "144358  0.986996  0.000999  0.002761  0.006481  \n",
       "144359  0.000160  0.006385  0.000598  0.005126  \n",
       "144360  0.013751  0.983524  0.000915  0.000092  \n",
       "144361  0.000287  0.001318  0.000246  0.000444  \n",
       "144362  0.004748  0.279907  0.007291  0.007874  \n",
       "144363  0.434420  0.019892  0.015795  0.043689  \n",
       "144364  0.000837  0.061283  0.000122  0.000333  \n",
       "144365  0.001326  0.007567  0.000346  0.000273  \n",
       "144366  0.000008  0.001050  0.000007  0.000019  \n",
       "144367  0.000884  0.036131  0.000100  0.000105  \n",
       "\n",
       "[144368 rows x 10 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "out_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "pycharm": {
   "stem_cell": {
    "cell_type": "raw",
    "metadata": {
     "collapsed": false
    },
    "source": []
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
